package com.power.sifa.approve.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  行政复议记事本信息实体类
*/

@Entity
@ApiModel(value="行政复议记事本信息")
@Data
@Table(name="Apl_notepad",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_notepad.Apl_notepadPK.class) 用于复合组件
public class Apl_notepad extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "记事本id")
    private String id;

    @ApiModelProperty(value = "记事标题")
    private String title;

    @ApiModelProperty(value = "记事的详细内容")
    private String content;

    @ApiModelProperty(value = "记事的创建人")
    private String author;

    @ApiModelProperty(value = "记事创建日期时间")
    private String createdate;

    @ApiModelProperty(value = "记事更新的日期时间")
    private String updatedate;

    @ApiModelProperty(value = "创建人id")
    private String userid;

    @ApiModelProperty(value = "案号")
    private String acceptcode;

    @ApiModelProperty(value = "applyid")
    private String applyid;

    @Transient
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Transient
    @ApiModelProperty(value = "申请人")
    private String applyname;

    @Transient
    @ApiModelProperty(value = "被申请人")
    private String targetname;

    @Transient
    @ApiModelProperty(value = "流程实例id")
    private String instid;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("title", this.getTitle());
        map.put("content", this.getContent());
        map.put("author", this.getAuthor());
        map.put("createdate", this.getCreatedate());
        map.put("updatedate", this.getUpdatedate());
        map.put("userid", this.getUserid());
        map.put("acceptcode", this.getAcceptcode());
        map.put("applyid", this.getApplyid());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_notepadPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_notepadPK pk = (Apl_notepadPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}